<template>
  <div class="personal">
    <div class="breadcrumb">
      <el-breadcrumb separator="/">
        <el-breadcrumb-item>个人中心</el-breadcrumb-item>
        <el-breadcrumb-item>首页</el-breadcrumb-item>
        <!-- <el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item> -->
      </el-breadcrumb>
    </div>
    <el-row :gutter="15" style="margin-top: 20px;width: 100%;">
      <el-col :span="5" class="left">
        <div class="person-info">
          <div class="avatar">
            <img src="@/assets/images/personal/u183.png" width="100" height="100" />
          </div>
          <div>
            <p>用户名：{{ username }}</p>
            <p>账号：{{ userId }}</p>
            <p>上次登录：{{ lastLogTime }}</p>
            <p>职业：{{ profession }}</p>
          </div>
        </div>
        <div class="side-nav">
          <el-menu :default-active="this.$route.path" router class="el-menu-vertical-demo">
            <el-menu-item v-for="(item,i) in links" :key="i" :index="item.path">
              <i :class="item.icon"></i>
              <span slot="title">{{ item.name }}</span>
            </el-menu-item>
          </el-menu>
        </div>
      </el-col>
      <el-col :span="19">
        <router-view></router-view>
      </el-col>
    </el-row>
  </div>
</template>

<script>
export default {
  data() {
    return {
      username: "摸鱼大佬",
      userId: "shabi666666",
      lastLogTime: "2019-01-01 00:00:00",
      profession: "JAVA工程师",
      links: [
        {
          path: "/personal",
          name: "首页",
          icon: 'el-icon-house'
        },
        {
          path: "/personal_task",
          name: "任务",
          icon: 'el-icon-discover'
        },
        {
          path: "/personal_artical",
          name: "我的文章",
          icon: 'el-icon-document'
        },
        {
          path: "/personal_setting",
          name: "设置",
          icon: 'el-icon-setting'
        }
      ]
    };
  }
};
</script>

<style lang="scss" scoped>
.personal {
  height: 1000px;
  padding-top: 20px;
  background-color: rgba(244, 244, 244, 1);
  .breadcrumb {
    margin-left: 30px;
  }
  .left {
    .person-info {
      height: 300px;
      padding-top: 30px;
      margin: 0 0 20px 30px;
      box-sizing: border-box;
      background-color: #fff;
      font-size: 14px;
      font-weight: 400;
      .avatar {
        width: 100px;
        height: 100px;
        margin: 0 auto 30px;
        background-color: rgb(0, 124, 226);
        border-radius: 50%;
        text-align: center;
      }
      p {
        margin: 10px;
        text-align: center;
      }
    }
    .side-nav {
      // height: 400px;
      margin: 0 0 20px 30px;
      background-color: #fff;
    }
  }
}
</style>